1. Field
Methods and apparatus consistent with exemplary embodiments relate to a method and a camera for detecting a region having a specific shape, and more particularly, to a method and a camera for detecting a region having a specific shape by which input image data is processed in the camera to detect the region having the specific shape.
2. Description of the Related Art
A camera, for example, a surveillance camera or a digital camera, may function to process input image data and detect a region having a specific shape, for example, a region of the human's face or a region of a license plate of a vehicle. The above-described function of the camera may be employed in many fields.
For example, a digital camera may correct a skin tone of the detected region of the human's face or remove defects from the detected region of the human's face. Also, only when the face turns towards a front surface of the camera by measuring an angle of the detected region of the human's face, the camera may capture an image or perform an auto-focus (AF) operation.
A surveillance camera may detect a face region and perform a surveillance function or pursue a motion track only when a human appears on the camera. Thus, unnecessary calculation amounts and storage spaces may be reduced.
When the surveillance camera watches an automated teller machine (ATM), the surveillance camera may determine a human's face during withdrawal of cash, the surveillance camera may prevent the withdrawal of cash when the human's face is disguised, and enable the withdrawal of the cash when the human's face is normally exposed.
Meanwhile, in another example, a surveillance camera may precisely detect a region of a license plate of a vehicle and aid in the capture of vehicles that violate traffic regulations.
FIG. 1 is a diagram illustrating a method of forming a local binary pattern (LBP) used for detecting a region having a specific shape in a typical camera. In FIG. 1, reference numeral 11 denotes a local region, 12 denotes a binary value of an LBP, and 13 denotes a denary value of an LBP.
Referring to FIG. 1, each of local regions 11 of an input image frame may include 9 pixels arranged in form of a 3×3 matrix. A method of obtaining a value of an LBP in each of the local regions 11 will now be described in detail.
Since a gradation 70 of a left-upper pixel is greater than a gradation 60 of a central pixel, binary data of a first bit (bit number 0, least significant bit (LSB) may be “1”.
Since a gradation 20 of a middle-upper pixel is less than the gradation 60 of the central pixel, binary data of a second bit (bit number 1) may be “0”. Similarly, since the gradation 20 of a right-upper pixel is less than the gradation 60 of the central pixel, binary data of a third bit (bit number 2) may be “0”.
Since a gradation 120 of a right-middle pixel is greater than the central pixel, binary data of the fourth bit (bit number 3) may be “1”. Similarly, when the gradation 120 of a right-lower pixel is greater than the gradation 60 of the central pixel, binary data of a fifth bit (bit number 4) may be “1”.
Since the gradation 20 of a middle-lower pixel is less than the gradation 60 of the central pixel, binary data of a sixth bit (bit number 5) may be “0”. Since the gradation 20 of a left-lower pixel is less than the gradation 60 of the central pixel, binary data of a seventh bit (bit number 6) may be “0”. Similarly, since a gradation 50 of a left-middle pixel is less than the gradation 60 of the central pixel, binary data of an eighth bit (bit number 7) may be “0”.
The above-described method of forming the LBP may be expressed as in Equation 1:
                                          LBP            ⁡                          (                                                x                  c                                ,                                  y                  c                                            )                                =                                    Q                              n                =                0                            7                        ⁢                          s              ⁡                              (                                                      i                    n                                    ,                                      i                    c                                                  )                                      ⁢                          2              n                                      ,                            (        1        )            wherein xc, yc denotes central coordinates of each of the local regions 11, ic denotes the gradation 60 of the central pixel, and in denotes each of the gradations of pixels disposed adjacent to the central pixel. Function of s(in−ic) is “1” when (in−ic) is zero (0) or more, and is “0” when (in−ic) is less than 0.
When a camera detects a region having a specific shape using an LBP as described above, since a gradation pattern is not directly used, the camera may be robust against a variation of illumination.
However, when a gradation difference between adjacent pixels is exceptionally great in an interfacial region having a specific shape, LBP values may be also exceptionally increased. Thus, detecting a region having a specific shape may be difficult under the circumstances of limited learning result data.
For example, when a human as a subject for photography wears very dark glasses at a high luminous intensity or wears very bright makeup at a low luminous intensity, detecting a face region may be difficult.
Similarly, when a license plate of a vehicle is against a very dark background in very bright light or is against a very bright background in very dark light, detecting a region of the license plate of the vehicle may be difficult.